﻿//**************************************************
//Prototype Character Generator
//Programed by: Michael Wolfe
//**************************************************

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace Character_Generator
{
    public partial class frmGenerator : Form
    {
        //Form Initilize Event
        public frmGenerator()
        {
            InitializeComponent();
        }

        //Initialize the form level varibles.
        byte bytBuildPoints = 25;
        byte bytStrength = 10;
        byte bytDexterity = 10;
        byte bytAgility = 10;
        byte bytConstitution = 10;
        byte bytAcumen = 10;
        byte bytFaith = 10;
        byte bytWillpower = 10;
        byte bytCharisma = 10;
        byte bytClass = 1;
        byte bytGender = 1;

        //Form Load Event
        private void frmGenerator_Load(object sender, EventArgs e)
        {

            //Load the lists for Primary and Secondary tradskills.
            lstPrimaryTradeSkills.Items.Add("Armorsmith");
            lstPrimaryTradeSkills.Items.Add("Weaponsmith");
            lstSecondaryTradeSkills.Items.Add("Herbalism");
            lstSecondaryTradeSkills.Items.Add("Lumberjacking");

            //Load the default Character Class Description.
            rtfClassDescription.Text = "Soldiers, warriors, men and women of strength, power, and discipline, "
            + "war burns through the blood of the Children of Ares.  These heroes "
            + "are skilled in the use of all weapons, armor, and shields and are the "
            + "only heroes capable of using heavy shields.  Supplementing their "
            + "training with weapons are various tactical maneuvers that they "
            + "have learned in the field of battle such as the Phalanx fighting "
            + "technique and the shield rush.  The primary statistics of a Child of "
            + "Ares are Strength, Dexterity, Agility, Constitution, and Willpower.  Faith "
            + "and Acumen do nothing for these heroes, as they rely more on their "
            + "instincts, training, and battle hardened senses to carry them through "
            + "the day.";

            //Load the default picture.
            picCharacter.Image = Image.FromFile("C:\\Program Files\\C# Programs\\HOD\\Character Generator\\Character Generator\\" + "yasnakiDarkKnight" + ".gif");

            //Create a text file called HOD Character Generator.txt in which to store character data.
            StreamWriter csww = new StreamWriter(@"C:\HOD Character Generator.txt", true);
            csww.Close();
        }

        //New Character Button Click Event
        private void btnNewChar_Click(object sender, EventArgs e)
        {

            //Open a StreamReader of the Data File.
            string line;
            byte bytCharacterCounter = 0;
            StreamReader csr = new StreamReader(@"C:\HOD Character Generator.txt");

            //Count the number of lines in the Data File and store that number in a variable.
            while ((line = csr.ReadLine()) != null)
            {
                bytCharacterCounter++;
            }

            //Prevent the Creation of a new character if there are already 8
            //by looking at the variable that stores the number of lines in
            //the Data File.
            if (bytCharacterCounter > 7)
            {
                MessageBox.Show("You may only create 8 characters.");
                return;
            }

            //Move from the welcome panel to the character creation panel.
            pnlWelcome.Visible = false;
            pnlCreation.Visible = true;

            //Reset the character creation panel.
            bytBuildPoints = 25;
            bytStrength = 10;
            bytDexterity = 10;
            bytAgility = 10;
            bytConstitution = 10;
            bytAcumen = 10;
            bytFaith = 10;
            bytWillpower = 10;
            bytCharisma = 10;
            bytClass = 1;
            bytGender = 1;
            lblBuildPoints.Text = "" + bytBuildPoints;
            lblStrength.Text = "" + bytStrength;
            lblDexterity.Text = "" + bytDexterity;
            lblAgility.Text = "" + bytAgility;
            lblConstitution.Text = "" + bytConstitution;
            lblAcumen.Text = "" + bytAcumen;
            lblFaith.Text = "" + bytFaith;
            lblWillpower.Text = "" + bytWillpower;
            lblCharisma.Text = "" + bytCharisma;
            lstPrimaryTradeSkills.SelectedIndex = -1;
            lstSecondaryTradeSkills.SelectedIndex = -1;
            radMale.Checked = true;
            radFemale.Checked = false;
            lblClass.Text = "Child of Ares";
            rtfClassDescription.Text = "Soldiers, warriors, men and women of strength, power, and discipline, "
            + "war burns through the blood of the Children of Ares.  These heroes "
            + "are skilled in the use of all weapons, armor, and shields and are the "
            + "only heroes capable of using heavy shields.  Supplementing their "
            + "training with weapons are various tactical maneuvers that they "
            + "have learned in the field of battle such as the Phalanx fighting "
            + "technique and the shield rush.  The primary statistics of a Child of "
            + "Ares are Strength, Dexterity, Agility, Constitution, and Willpower.  Faith "
            + "and Acumen do nothing for these heroes, as they rely more on their "
            + "instincts, training, and battle hardened senses to carry them through "
            + "the day.";
            picCharacter.Image = Image.FromFile("C:\\Program Files\\C# Programs\\HOD\\Character Generator\\Character Generator\\" + "yasnakiDarkKnight" + ".gif");
            txtName.Text = "";
        }

        //View Old Character Button Click Event
        private void btnViewOldChar_Click(object sender, EventArgs e)
        {

            //Display the form for Generated Characters and make sure it's positioned properly.
            pnlWelcome.Visible = false;
            Created_Characters newMDIChild = new Created_Characters(this);
            newMDIChild.MdiParent = this;
            newMDIChild.StartPosition = FormStartPosition.CenterScreen;
            newMDIChild.Show();
        }

        //Allow the other form to talk to use this command,
        //which is why it's a public Class.  This will happen
        //when the Back button is pressed on the other form.
        public void frmclose()
        {
            pnlWelcome.Visible = true;
        }

        //Character Creation Strength Up Button Click Event
        private void btnStengthUp_Click(object sender, EventArgs e)
        {

            //Increase strength and decrease build points.
            if (bytBuildPoints > 0 & bytStrength < 20)
            {
                bytBuildPoints--;
                bytStrength++;
                lblStrength.Text = "" + bytStrength;
                lblBuildPoints.Text = "" + bytBuildPoints;
            }
        }

        //Character Creation Strength Down Button Click Event
        private void btnStrengthDown_Click(object sender, EventArgs e)
        {

            //Decrease strength and increase build points.
            if (bytBuildPoints < 25 & bytStrength > 10)
            {
                bytBuildPoints++;
                bytStrength--;
                lblStrength.Text = "" + bytStrength;
                lblBuildPoints.Text = "" + bytBuildPoints;
            }

        }

        //Character Creation Dexterity Up Button Click Event
        private void btnDexterityUp_Click(object sender, EventArgs e)
        {

            //Increase dexterity and decrease build points.
            if (bytBuildPoints > 0 & bytDexterity < 20)
            {
                bytBuildPoints--;
                bytDexterity++;
                lblDexterity.Text = "" + bytDexterity;
                lblBuildPoints.Text = "" + bytBuildPoints;
            }
        }

        //Character Creation Dexterity Down Button Click Event
        private void btnDexterityDown_Click(object sender, EventArgs e)
        {

            //Decrease dexterity and increase build points.
            if (bytBuildPoints < 25 & bytDexterity > 10)
            {
                bytBuildPoints++;
                bytDexterity--;
                lblDexterity.Text = "" + bytDexterity;
                lblBuildPoints.Text = "" + bytBuildPoints;
            }

        }

        //Character Creation Agility Up Button Click Event
        private void btnAgilityUp_Click(object sender, EventArgs e)
        {

            //Increase agility and decrease build points.
            if (bytBuildPoints > 0 & bytAgility < 20)
            {
                bytBuildPoints--;
                bytAgility++;
                lblAgility.Text = "" + bytAgility;
                lblBuildPoints.Text = "" + bytBuildPoints;
            }

        }

        //Character Creation Agility Down Button Click Event
        private void btnAgilityDown_Click(object sender, EventArgs e)
        {

            //Decrease agility and increase build points.
            if (bytBuildPoints < 25 & bytAgility > 10)
            {
                bytBuildPoints++;
                bytAgility--;
                lblAgility.Text = "" + bytAgility;
                lblBuildPoints.Text = "" + bytBuildPoints;
            }
        }

        //Character Creation Constitution Up Button Click Event
        private void btnConstitutionUp_Click(object sender, EventArgs e)
        {

            //Increase constituion and decrease build points.
            if (bytBuildPoints > 0 & bytConstitution < 20)
            {
                bytBuildPoints--;
                bytConstitution++;
                lblConstitution.Text = "" + bytConstitution;
                lblBuildPoints.Text = "" + bytBuildPoints;
            }
        }

        //Character Creation Constitution Down Button Click Event
        private void btnConstitutionDown_Click(object sender, EventArgs e)
        {

            //Decrease constitution and increase build points.
            if (bytBuildPoints < 25 & bytConstitution > 10)
            {
                bytBuildPoints++;
                bytConstitution--;
                lblConstitution.Text = "" + bytConstitution;
                lblBuildPoints.Text = "" + bytBuildPoints;
            }

        }

        //Character Creation Acumen Up Button Click Event
        private void btnAcumenUp_Click(object sender, EventArgs e)
        {

            //Increase acumen and decrease build points.
            if (bytBuildPoints > 0 & bytAcumen < 20)
            {
                bytBuildPoints--;
                bytAcumen++;
                lblAcumen.Text = "" + bytAcumen;
                lblBuildPoints.Text = "" + bytBuildPoints;
            }
        }

        //Character Creation Acumen Down Button Click Event
        private void btnAcumenDown_Click(object sender, EventArgs e)
        {

            //Decrease acumen and increase build points.
            if (bytBuildPoints < 25 & bytAcumen > 10)
            {
                bytBuildPoints++;
                bytAcumen--;
                lblAcumen.Text = "" + bytAcumen;
                lblBuildPoints.Text = "" + bytBuildPoints;
            }

        }

        //Character Creation Faith Up Button Click Event
        private void btnFaithUp_Click(object sender, EventArgs e)
        {

            //Increase faith and decrease build points.
            if (bytBuildPoints > 0 & bytFaith < 20)
            {
                bytBuildPoints--;
                bytFaith++;
                lblFaith.Text = "" + bytFaith;
                lblBuildPoints.Text = "" + bytBuildPoints;
            }

        }

        //Character Creation Faith Down Button Click Event
        private void btnFaithDown_Click(object sender, EventArgs e)
        {

            //Decrease faith and increase build points.
            if (bytBuildPoints < 25 & bytFaith > 10)
            {
                bytBuildPoints++;
                bytFaith--;
                lblFaith.Text = "" + bytFaith;
                lblBuildPoints.Text = "" + bytBuildPoints;
            }

        }

        //Character Creation Willpower Up Button Click Event
        private void btnWillpowerUp_Click(object sender, EventArgs e)
        {

            //Increase willpower and decrease build points.
            if (bytBuildPoints > 0 & bytWillpower < 20)
            {
                bytBuildPoints--;
                bytWillpower++;
                lblWillpower.Text = "" + bytWillpower;
                lblBuildPoints.Text = "" + bytBuildPoints;
            }

        }

        //Character Creation Willpower Down Button Click Event
        private void btnWillpowerDown_Click(object sender, EventArgs e)
        {

            //Decrease willpower and increase build points.
            if (bytBuildPoints < 25 & bytWillpower > 10)
            {
                bytBuildPoints++;
                bytWillpower--;
                lblWillpower.Text = "" + bytWillpower;
                lblBuildPoints.Text = "" + bytBuildPoints;
            }

        }

        //Character Creation Charisma Up Button Click Event
        private void btnCharismaUp_Click(object sender, EventArgs e)
        {

            //Increase charisma and decrease build points.
            if (bytBuildPoints > 0 & bytCharisma < 20)
            {
                bytBuildPoints--;
                bytCharisma++;
                lblCharisma.Text = "" + bytCharisma;
                lblBuildPoints.Text = "" + bytBuildPoints;
            }
        }

        //Character Creation Charisma Down Button Click Event
        private void btnCharismaDown_Click(object sender, EventArgs e)
        {

            //Decrease charisma and increase build points.
            if (bytBuildPoints < 25 & bytCharisma > 10)
            {
                bytBuildPoints++;
                bytCharisma--;
                lblCharisma.Text = "" + bytCharisma;
                lblBuildPoints.Text = "" + bytBuildPoints;
            }
        }


        //Character Creation Character Class Forward Button Click Event
        private void btnClassForward_Click(object sender, EventArgs e)
        {

            //Scroll forward through the classes and update their information accordingly.
            switch (bytClass)
            {
                case 1:
                    bytClass = 2;
                    lblClass.Text = "Child of Hermes";
                    rtfClassDescription.Text = "A thief in the night, an assassin in the shadows, a spy behind enemy "
                    + "lines, these are the traits that make up the Children of Hermes. "
                    + "Possessing a keen wit and sharp blade, these heroes are frail but"
                    + "deadly.  They are learned in many abilities of subterfuge and  "
                    + "assassination and are skilled in the use of various drugs and poisons. "
                    + "Their primary statistics are Strength, Dexterity, Acumen, Willpower, "
                    + "and Charisma.  Faith does nothing for them, and Agility and "
                    + "Constitution, while not useless, are overridden by this hero's ability to "
                    + "hide in the shadows.  They favor weapons that are light weight and "
                    + "easily concealed, such as the sling and the dagger.";
                    if (bytGender == 1)
                    {
                        picCharacter.Image = Image.FromFile("C:\\Program Files\\C# Programs\\HOD\\Character Generator\\Character Generator\\" + "maleThiefGrey" + ".gif");
                    }
                    else
                    {
                        picCharacter.Image = Image.FromFile("C:\\Program Files\\C# Programs\\HOD\\Character Generator\\Character Generator\\" + "femaleThiefBrown" + ".gif");
                    }
                    break;

                case 2:
                    bytClass = 3;
                    lblClass.Text = "Child of Apollo";
                    rtfClassDescription.Text = "The Children of Apollo are a closed, monastic group who make up "
                    + "the clergy of the Cult of Apollo.  Skilled in the art of healing and gifted "
                    + "with the Second Sight, only a member from this Order may become an "
                    + "Oracle, a position revered by all of Greece.  In touch with their deity, "
                    + "these heroes favor the bow and are possessing of athleticism as well "
                    + "as great faith.  Their primary statistics are Strength, Dexterity, Faith, "
                    + "Willpower, and Charisma.  Acumen is of little use to them as they look "
                    + "to their deity for the secrets of the universe.  Agility and Constitution are "
                    + "of less use as well, since many of their prayers will compensate for a "
                    + "lack in these disciplines.";
                    if (bytGender == 1)
                    {
                        picCharacter.Image = Image.FromFile("C:\\Program Files\\C# Programs\\HOD\\Character Generator\\Character Generator\\" + "maleguide" + ".png");
                    }
                    else
                    {
                        picCharacter.Image = Image.FromFile("C:\\Program Files\\C# Programs\\HOD\\Character Generator\\Character Generator\\" + "femaleguide" + ".png");
                    }
                    break;

                case 3:
                    bytClass = 1;
                    lblClass.Text = "Child of Ares";
                    rtfClassDescription.Text = "Soldiers, warriors, men and women of strength, power, and discipline, "
                    + "war burns through the blood of the Children of Ares.  These heroes "
                    + "are skilled in the use of all weapons, armor, and shields and are the "
                    + "only heroes capable of using heavy shields.  Supplementing their "
                    + "training with weapons are various tactical maneuvers that they "
                    + "have learned in the field of battle such as the Phalanx fighting "
                    + "technique and the shield rush.  The primary statistics of a Child of "
                    + "Ares are Strength, Dexterity, Agility, Constitution, and Willpower.  Faith "
                    + "and Acumen do nothing for these heroes, as they rely more on their "
                    + "instincts, training, and battle hardened senses to carry them through "
                    + "the day.";
                    if (bytGender == 1)
                    {
                        picCharacter.Image = Image.FromFile("C:\\Program Files\\C# Programs\\HOD\\Character Generator\\Character Generator\\" + "yasnakiDarkKnight" + ".gif");
                    }
                    else
                    {
                        picCharacter.Image = Image.FromFile("C:\\Program Files\\C# Programs\\HOD\\Character Generator\\Character Generator\\" + "yasnakiWarrior" + ".gif");
                    }
                    break;
            }
        }

        //Character Creation Character Class Backward Button Click Event
        private void btnClassBack_Click(object sender, EventArgs e)
        {

            //Scroll backwards through the classes and update their information accordingly.
            switch (bytClass)
            {
                case 1:
                    bytClass = 3;
                    lblClass.Text = "Child of Apollo";
                    rtfClassDescription.Text = "The Children of Apollo are a closed, monastic group who make up "
                    + "the clergy of the Cult of Apollo.  Skilled in the art of healing and gifted "
                    + "with the Second Sight, only a member from this Order may become an "
                    + "Oracle, a position revered by all of Greece.  In touch with their deity, "
                    + "these heroes favor the bow and are possessing of athleticism as well "
                    + "as great faith.  Their primary statistics are Strength, Dexterity, Faith, "
                    + "Willpower, and Charisma.  Acumen is of little use to them as they look "
                    + "to their deity for the secrets of the universe.  Agility and Constitution are "
                    + "of less use as well, since many of their prayers will compensate for a "
                    + "lack in these disciplines.";
                    if (bytGender == 1)
                    {
                        picCharacter.Image = Image.FromFile("C:\\Program Files\\C# Programs\\HOD\\Character Generator\\Character Generator\\" + "maleguide" + ".png");
                    }
                    else
                    {
                        picCharacter.Image = Image.FromFile("C:\\Program Files\\C# Programs\\HOD\\Character Generator\\Character Generator\\" + "femaleguide" + ".png");
                    }
                    break;

                case 2:
                    bytClass = 1;
                    lblClass.Text = "Child of Ares";
                    rtfClassDescription.Text = "Soldiers, warriors, men and women of strength, power, and discipline, "
                    + "war burns through the blood of the Children of Ares.  These heroes "
                    + "are skilled in the use of all weapons, armor, and shields and are the "
                    + "only heroes capable of using heavy shields.  Supplementing their "
                    + "training with weapons are various tactical maneuvers that they "
                    + "have learned in the field of battle such as the Phalanx fighting "
                    + "technique and the shield rush.  The primary statistics of a Child of "
                    + "Ares are Strength, Dexterity, Agility, Constitution, and Willpower.  Faith "
                    + "and Acumen do nothing for these heroes, as they rely more on their "
                    + "instincts, training, and battle hardened senses to carry them through "
                    + "the day.";
                    if (bytGender == 1)
                    {
                        picCharacter.Image = Image.FromFile("C:\\Program Files\\C# Programs\\HOD\\Character Generator\\Character Generator\\" + "yasnakiDarkKnight" + ".gif");
                    }
                    else
                    {
                        picCharacter.Image = Image.FromFile("C:\\Program Files\\C# Programs\\HOD\\Character Generator\\Character Generator\\" + "yasnakiWarrior" + ".gif");
                    }
                    break;

                case 3:
                    bytClass = 2;
                    lblClass.Text = "Child of Hermes";
                    lblClass.Text = "Child of Hermes";
                    rtfClassDescription.Text = "A thief in the night, an assassin in the shadows, a spy behind enemy "
                    + "lines, these are the traits that make up the Children of Hermes. "
                    + "Possessing a keen wit and sharp blade, these heroes are frail but "
                    + "deadly.  They are learned in many abilities of subterfuge and "
                    + "assassination and are skilled in the use of various drugs and poisons. "
                    + "Their primary statistics are Strength, Dexterity, Acumen, Willpower, "
                    + "and Charisma.  Faith does nothing for them, and Agility and "
                    + "Constitution, while not useless, are overridden by this hero's ability to "
                    + "hide in the shadows.  They favor weapons that are light weight and "
                    + "easily concealed, such as the sling and the dagger.";
                    if (bytGender == 1)
                    {
                        picCharacter.Image = Image.FromFile("C:\\Program Files\\C# Programs\\HOD\\Character Generator\\Character Generator\\" + "maleThiefGrey" + ".gif");
                    }
                    else
                    {
                        picCharacter.Image = Image.FromFile("C:\\Program Files\\C# Programs\\HOD\\Character Generator\\Character Generator\\" + "femaleThiefBrown" + ".gif");
                    }
                    break;
            }

        }



        //Male Radiobutton Click Event
        private void radMale_CheckedChanged(object sender, EventArgs e)
        {

            //Set the gender to male.
            bytGender = 1;

            //Change the Character Class picture to represent the appropriate gender.
            switch (bytClass)
            {
                case 1:
                    picCharacter.Image = Image.FromFile("C:\\Program Files\\C# Programs\\HOD\\Character Generator\\Character Generator\\" + "yasnakiDarkKnight" + ".gif");
                    break;

                case 2:
                    picCharacter.Image = Image.FromFile("C:\\Program Files\\C# Programs\\HOD\\Character Generator\\Character Generator\\" + "maleThiefGrey" + ".gif");
                    break;

                case 3:
                    picCharacter.Image = Image.FromFile("C:\\Program Files\\C# Programs\\HOD\\Character Generator\\Character Generator\\" + "maleguide" + ".png");
                    break;
            }
        }

        //Female Radiobutton Click Event
        private void radFemale_CheckedChanged(object sender, EventArgs e)
        {

            //Set the gender to female.
            bytGender = 2;

            //Change the Character Class picture to represent the appropriate gender.
            switch (bytClass)
            {
                case 1:
                    picCharacter.Image = Image.FromFile("C:\\Program Files\\C# Programs\\HOD\\Character Generator\\Character Generator\\" + "yasnakiWarrior" + ".gif");
                    break;

                case 2:
                    picCharacter.Image = Image.FromFile("C:\\Program Files\\C# Programs\\HOD\\Character Generator\\Character Generator\\" + "femaleThiefBrown" + ".gif");
                    break;

                case 3:
                    picCharacter.Image = Image.FromFile("C:\\Program Files\\C# Programs\\HOD\\Character Generator\\Character Generator\\" + "femaleguide" + ".png");
                    break;
            }
        }

        //Character Creation Save Button Click Event
        private void btnCreationSave_Click(object sender, EventArgs e)
        {

            //Assign variables to be used in this event.
            string strCharacterName = (txtName.Text);
            string strPrimaryTrade = (lstPrimaryTradeSkills.Text);
            string strSecondaryTrade = (lstSecondaryTradeSkills.Text);

            //Has the user entered a name?
            if (strCharacterName == "")
            {
                MessageBox.Show("You must enter a name.");
                txtName.Focus();
                return;
            }

            //Is the character name too long?
            if (strCharacterName.Length > 15)
            {
                MessageBox.Show("Character Names can must be"
                + "\n" + "no longer than 15 characters.");
                txtName.Focus();
                return;
            }

            //Has the user declared the character stats?
            if (bytBuildPoints != 0)
            {
                MessageBox.Show("You must spend all your Build Points.");
                return;
            }

            //Has the user picked a primary trade skill?
            if (strPrimaryTrade == "")
            {
                MessageBox.Show("You must select a primary trade skill.");
                return;
            }

            //Has the user picked a secondary trade skill?
            if (strSecondaryTrade == "")
            {
                MessageBox.Show("You must select a secondary trade skill.");
                return;
            }

            //Display a message box that warns the user of the consequences of the
            //Save button and ask if the user is certain about the descision.
            DialogResult a;
            a = MessageBox.Show("Are you sure you wish to save this character?",
                "Are you sure?",
                MessageBoxButtons.YesNo,
                MessageBoxIcon.Question,
                MessageBoxDefaultButton.Button2);

            if (a == DialogResult.Yes)
            {

                //Append a text file called Generator.txt in which to store character data.
                StreamWriter csw = new StreamWriter(@"C:\HOD Character Generator.txt", true);

                //Append the character stats to Generator.txt
                csw.WriteLine(strCharacterName + ","
                    + bytClass + ","
                    + bytGender + ","
                    + bytStrength + ","
                    + bytDexterity + ","
                    + bytAgility + ","
                    + bytConstitution + ","
                    + bytAcumen + ","
                    + bytFaith + ","
                    + bytWillpower + ","
                    + bytCharisma + ","
                    + strPrimaryTrade + ","
                    + strSecondaryTrade);
                csw.Close();

                //Return to the welcome panel.
                pnlCreation.Visible = false;
                pnlWelcome.Visible = true;
            }
        }

            //Character Creation Back Button Click Event
        private void btnCreationBack_Click(object sender, EventArgs e)
        {

            //Display a message box that warns the user of the consequences of the
            //back button and ask if the user is certain about the descision.
            DialogResult a;
            a = MessageBox.Show("Going back will delete any unsaved changes to a character."
                + "\n"
                + "Are you sure you wish to go back?",
                "Are you sure?",
                MessageBoxButtons.YesNo,
                MessageBoxIcon.Warning,
                MessageBoxDefaultButton.Button2);

            if (a == DialogResult.Yes)
            {
                //Move from the character creation panel to the welcome panel.
                pnlCreation.Visible = false;
                pnlWelcome.Visible = true;
            }
        }
    }
}
